<?php
/**
 * Process to show HorMenu image on Front-end, if the file is not found, show
 * site name alternately
 *
 * Call as $this->showHorMenuArea() in layout script
 * 
 * @package    Front
 * @subpackage Front_View
 * @category   View_Helper
 * @since    $Id: $
 */
class Front_View_Helper_ShowHorMenuArea extends Zend_View_Helper_Abstract
{
    /** @var Zend_View_Interface $view */
    public $view;

    /**
     * Set $view object to current view
     * 
     * @param Zend_View_Interface $view
     */
    public function setView(Zend_View_Interface $view)
    {
        $this->view = $view;
    }
    
    
    /**
     * show HorMenu image on Front-end, 
     * if the file is not found, show site name alternately
     * 
     * @return string Base URL
     */
    public function showHorMenuArea()
    {
    	$horMenu = "";
    	$horMenu .= '<table width="100%" cellspacing="0" cellpadding="0" border="0" align="right">';
        $horMenu .= '<tbody>';
        $horMenu .= '<tr style="background-image:url(/img/menu_hor_center.jpg); background-repeat:repeat-x">';
		$horMenu .= '<td class="td-img" width="9" align="left" nowrap="nowrap">';
		$horMenu .= '<img src="/img/menu_hor_left.jpg">';
		$horMenu .= '</td>';
		$horMenu .= '<td class="td-img" width="20%" align="left" nowrap="nowrap">';
		$horMenu .= '<img src="/img/menu_hor_center.jpg">';
		$horMenu .= '</td>';
		$horMenu .= $this->_getMenuLine();		
		$horMenu .= '<td class="td-img" align="center" nowrap="nowrap" id="1">';
		$horMenu .= '<a class="topMenu" id="a1" href="/">home</a>';
		$horMenu .= '</td>';
		$horMenu .= $this->_getMenuLine();	
		$horMenu .= '<td class="td-img" align="center" nowrap="nowrap" id="2">';
		$horMenu .= '<a class="topMenu" id="a2" href="/info/about">about us</a>';
		$horMenu .= '</td>';
		$horMenu .= $this->_getMenuLine();	
		$horMenu .= '<td class="td-img" align="center" nowrap="nowrap" id="3">';
		$horMenu .= '<a class="topMenu" id="a3" href="/project/news/">news</a>';
		$horMenu .= '</td>';
		$horMenu .= $this->_getMenuLine();
		$horMenu .= '<td class="td-img" align="center" nowrap="nowrap" id="4">';
		$horMenu .= '<a class="topMenu" id="a4" href="/project/">projects</a>';
		$horMenu .= '</td>';
		$horMenu .= $this->_getMenuLine();
		$horMenu .= '<td class="td-img" align="center" nowrap="nowrap" id="5">';
		$horMenu .= '<a class="topMenu" id="a5" href="/project/event/">events</a>';
		$horMenu .= '</td>';
		$horMenu .= $this->_getMenuLine();
		$horMenu .= '<td class="td-img" align="center" nowrap="nowrap" id="6">';
		$horMenu .= '<a class="topMenu" id="a6" href="/project/galary/">galary</a>';
		$horMenu .= '</td>';
		$horMenu .= $this->_getMenuLine();
		$horMenu .= '<td class="td-img" align="center" nowrap="nowrap" id="7">';
		$horMenu .= '<a class="topMenu" id="a7" href="/info/contact">contact</a>';
		$horMenu .= '</td>';
		$horMenu .= '<td class="td-img" width="9" align="right" nowrap="nowrap">';
		$horMenu .= '<img src="/img/menu_hor_right.jpg">';
		$horMenu .= '</td>';
		$horMenu .= '</tr>';
		$horMenu .= '</tbody>';
		$horMenu .= '</table>';
        return $horMenu;
    }
    
    /**
     * Get the menu line
     * 
     * @return string
     */
    private function _getMenuLine()
    {
    	$menuLine = '';
    	$menuLine .= '<td class="td-img" width="3" align="right" nowrap="nowrap">';
		$menuLine .= '<img src="/img/menu_hor_line.jpg">';
		$menuLine .= '</td>';
    	return $menuLine;
    }
}